<?php
namespace app\common\constant;
class CacheKey
{
    const USER_STATUS_ONLINE = 'user_status_online:$user_sn';

    const LOCK_TIME = 3;

    /**
     * 格式化Cache key.
     *
     * @param string $fmt
     * @param array $args
     * @return string
     */
    public static function fmt($fmt, $args = [])
    {
        $parse = function ($__fmt__, $args) {
            extract($args);
            @eval('$key = "' . $__fmt__ . '";');

            /*@var $key string */
            return $key;
        };
        return $parse($fmt, $args);
    }

}
